home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / docs / mags / AIOV55.lha / AIOIssue55 / examples / 2.1.1_lotto_simple.c < prev    next >
Encoding:
C/C++ Source or Header  |  1980-01-01  |  396 b   |  18 lines

  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.   long int secret[10];
  6.   int i = 0;
  7.  
  8.   for (i = 0; i <= 9; i++)                          /* GOTCHA!!! Arrays _ALWAYS_ start at element 0. Always. */
  9.   {
  10.     printf("\nEnter secret number #%i: ", i);
  11.     scanf("%i", &secret[i]);
  12.   }
  13.   printf("All done. The secret numbers were:\n");
  14.   for (i = 0; i <= 9; i++) printf("\n#%i: %i", i, secret[i]);
  15.  
  16.   return 0;
  17. }
  18.